# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Oliver Smith <ollieparanoid@postmarketos.org>
pkgname=pmbootstrap
pkgver=2.3.3
pkgrel=0
pkgdesc="Sophisticated chroot/build/flash tool to develop and install postmarketOS"
url="https://gitlab.postmarketos.org/postmarketOS/pmbootstrap"
arch="noarch"
license="GPL-3.0-or-later"
depends="
	git
	openssl
	python3
	"
makedepends="py3-gpep517 py3-setuptools py3-wheel python3-dev"
checkdepends="pytest"
subpackages="$pkgname-pyc"
source="https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/archive/$pkgver/pmbootstrap-$pkgver.tar.bz2
	modules-load.conf
	"
install="$pkgname.post-install"
options="!check" # Tests require chroot etc.

build() {
	gpep517 build-wheel \
		--wheel-dir dist \
		--output-fd 3 3>&1 >&2
}

package() {
	python3 -m installer -d "$pkgdir" \
		dist/*.whl
	install -Dm644 "$srcdir"/modules-load.conf "$pkgdir"/usr/lib/modules-load.d/pmbootstrap.conf
}

sha512sums="
d59e254482077f061ef78c4ce7f5f9d1e8be4a1a58f3125430c52bba6cb379b0eb9e60dc8802da8a94284458c30c225e8a558fe9a38885143c1e5efe1ffad92c  pmbootstrap-2.3.3.tar.bz2
f8026ab32234b885e69252459047f70160c54319113bc449000aa7c05bd016f00a46cee05c8f5251682f967ab44a12c06fbbb3c02d0a57ccb836cff810ce1a40  modules-load.conf
"
